<!DOCTYPE html>
<html>
<head>
    <title>Admin</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link  href="<?php echo base_url();?>css/admin.css" rel="stylesheet" type="text/css" />
	
	<link href="<?php echo base_url();?>css/uni-form.css" media="screen" rel="stylesheet"/>
    <link href="<?php echo base_url();?>css/demo.css" media="screen" rel="stylesheet"/>
    <link href="<?php echo base_url();?>css/default.uni-form.css" id="formStyle" title="Default Style" media="screen" rel="stylesheet"/>
	

    
    <!--[if lte ie 7]>
      <style type="text/css" media="screen">
        /* Move these to your IE6/7 specific stylesheet if possible */
        .uniForm, .uniForm fieldset, .uniForm .ctrlHolder, .uniForm .formHint, .uniForm .buttonHolder, .uniForm .ctrlHolder ul{ zoom:1; }
      </style>
    <![endif]-->
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>js/uni-form.jquery.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>js/uni-form-validation.jquery.js" charset="utf-8"></script>
    <script type="text/javascript">
      $(function(){
        
        // init Uni-Form
        $('form.uniForm').uniform({
          prevent_submit : true
        });
        
        // specific for this page
        $(".browse a").click(function(e) {
          e.preventDefault();
          $("#formStyle").attr("href",$(this).attr('rel'));
          return false;
        });
      });
    </script>

    
    
    <!-- JS2CAL -->
	<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/jscal2/jscal2.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/jscal2/border-radius.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/jscal2/steel/steel.css" />
    <script type="text/javascript" src="<?php echo base_url();?>js/jscal2/jscal2.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>js/jscal2/lang/th.js"></script>
	
</head>
<body>

 <div id="contentright">
        <div id="search">
          <div id="searchblank">
            <div id="searchinput">
             Welcome, admin
            </div>
          
            <div id="advancesearch"><a href="#" class="advancesearch">Logout</a></div>
          </div>
        </div>
        </div>
    <div id="main">
        <?php 
        $menu['nowmenu'] = 'members';
        $this->load->view('common/divheader',$menu);
        ?>
        <div id="middle">
            <div id="left-column">
                <h3>Header</h3>
                <ul class="nav">
                    <li><a href="#">จำนวนเกษตรกร 1,000 คน</a></li>
                    <li><a href="#">พื้นที่รวม 1,700.5 ไร่</a></li>
                    <li><a href="#">ปริมาณผลผลิต 50,000 ตัน</a></li>
                    <li><a href="#">รวมซื้อวัตถุดิบ 30,000,000 บาท</a></li>
                    <li><a href="#">ราคามันเฉลี่ย 6.75 บาท</a></li>
                    <li><a href="#">คุณภาพแป้งเแลี่ย 100%</a></li>
                </ul>
                <a href="#" class="link">Link here</a>
                <a href="#" class="link">Link here</a>
            </div>
            <div id="center-column">
                <form name="form1" action="<?php 
                	if ($uuid == 0) echo site_url('users/saveForm');
                	else echo site_url('users/detail/'.$uuid);
                ?>" class="uniForm" method="post" enctype="multipart/form-data">
      
            
      <fieldset>
        <h3>ข้อมูล</h3>
        <input type="hidden" name="uuid" value="<?php echo $uuid;?>">
        <div class="ctrlHolder">
          <label for=""><em>*</em>ชื่อ</label>
          <input name="vfirstname" id="" size="35" maxlength="50" type="text" class="textInput small required" value="<?=isset_or($vfirstname,'');?>"/>
          <p class="formHint"></p>
        </div>
		
		<div class="ctrlHolder">
          <label for=""><em>*</em>นามสกุล</label>
          <input name="vlastname" id="" size="35" maxlength="50" type="text" class="textInput small required" value="<?=isset_or($vlastname,'');?>"/>
          <p class="formHint"></p>
        </div>
		
		<div class="ctrlHolder">
          <p class="label">
            <em>*</em> เพศ
          </p>
				<input id="" name="vgender" type="radio" class="required" value="ชาย" <?php echo isset_or($vgender)=='ชาย'?'checked':'';  ?>/>ชาย
				<input id="" name="vgender" type="radio" class="required" value="หญิง" <?php echo isset_or($vgender)=='หญิง'?'checked':'';  ?>/>หญิง
          <p class="formHint"></p>
        </div>
        
        <div class="ctrlHolder">
          <label for=""><em>*</em>วันเกิด</label>
          <input name="vbirthdate" size="30" id="f_date1" data-default-value="yyyy-mm-dd" class="textInput small required" value="<?=isset_or($vbirthdate,'');?>"/>
          <button id="f_btn1">...</button><br />

    <script type="text/javascript">//<![CDATA[
      Calendar.setup({
        inputField : "f_date1",
        trigger    : "f_btn1",
        onSelect   : function() { this.hide() },
        dateFormat : "%Y-%m-%d",
        max		   : <?php echo date('Ymd');?>,
        bottomBar	: false
      });
    //]]></script>
          <p class="formHint"></p>
        </div>


	<div class="ctrlHolder">
          <label for="">สถานะ</label>
          <select name="vtype" id="" class="selectInput small">
      			<?php 
      			foreach ($type_option as $eachtype):
      			?>
      				<option value="<?=$eachtype['typeid'];?>" <?=($eachtype['typeid']==isset_or($vtype,''))?'selected':'';?> ><?=$eachtype['typename'];?></option>

      			<?php 
      			endforeach;
      			?>
          </select>
          <p class="formHint"></p>
        </div>

      </fieldset>
      
      <fieldset>
        <h3>ติดต่อ</h3>
        
        <div class="ctrlHolder">
          <p class="label">ที่อยู่</p>
          <ul>
            <li><label for="">บ้านเลขที่ <input name="housenum" type="text" id="" name="" class="textInput small" value="<?=isset_or($housenum,'');?>"/></label></li>
            <li><label for="">หมู่บ้าน
            <select name="village" id="" class="selectInput small required">
            	<option value="" >หมู่บ้าน</option>
      			<?php 
      			foreach ($village_option as $eachoption):
      			?>
      				<option value="<?=$eachoption['villageid'];?>" <?=($eachoption['villageid']==isset_or($village,''))?'selected':'';?> ><?=$eachoption['villagename'];?></option>

      			<?php 
      			endforeach;
      			?>
          </select>
      
             </label></li>
            <li><label for="">หมู่ที่ <input name="moono" type="text" id="" name="" class="textInput small" value="<?=isset_or($moono,'');?>"/></label></li>
            <li><label for="">ถนน <input name="street" type="text" id="" name="" class="textInput small" value="<?=isset_or($street,'');?>"/></label></li>
            <li><label for="">ตำบล <input name="district" type="text" id="" name="" class="textInput small" value="<?=isset_or($district,'');?>"/></label></li>
            <li><label for="">อำเภอ <input name="city" type="text" id="" name="" class="textInput small required" value="<?=isset_or($city,'');?>"/></label></li>
            <li><label for="">จังหวัด <input name="province" type="text" id="" name="" class="textInput small" value="<?=isset_or($province,'');?>"/></label></li>
            <li><label for="">รหัสไปรษณีย์ <input name="zipcode" type="text" id="" name="" class="textInput small" value="<?=isset_or($zipcode,'');?>"/></label></li>
          </ul>
          <p class="formHint"></p>
        </div>
        
        <div class="ctrlHolder">
          <p class="label">อื่นๆ</p>
          <ul>
            <li><label for="">อีเมล์<input type="text" id="" name="vemail" class="textInput small" value="<?=isset_or($vemail,'');?>"/></label></li>
            <li><label for="">เบอร์บ้าน <input type="text" id="" name="vphone" class="textInput small" value="<?=isset_or($vphone,'');?>"/></label></li>
            <li><label for="">เบอร์มือถือ <input type="text" id="" name="vmobile" class="textInput small" value="<?=isset_or($vmobile,'');?>"/></label></li>
          </ul>
          <p class="formHint"></p>
        </div>
        
        <fieldset>
        <h3>ครอบครัว</h3>
        <div class="ctrlHolder">
        <ul>
        	<li>
          <p class="label">
           		 สถานะ
          </p>
				<input id="" name="vstatus" type="radio" class="required" value="โสด" <?php echo isset_or(vstatus)=='โสด'?'checked':'';  ?>/>โสด </br>
				<input id="" name="vstatus" type="radio" class="required" value="สมรส" <?php echo isset_or(vstatus)=='สมรส'?'checked':'';  ?>/>สมรส		
        </li>
        <li> <input type="text"/> </li>
        </ul>
          
        </div>
        
        
        
        
        
        </fieldset>
        
        <fieldset>
        <h3>หลักฐาน</h3>
        <div class="ctrlHolder">
          <label for="">บัตรประชาชน</label>
          <input type="file" id="" name="file1" size="35" class="fileUpload" accept="image/*" />
          <?php 
          	if (isset($file1)){
          		echo "<img src='$file1'/>";
          	}
          ?>
          <p class="formHint"></p>
        </div>
        
        <div class="ctrlHolder">
          <label for="">ทะเบียนบ้าน</label>
          <input type="file" id="" name="file2" size="35" class="fileUpload" accept="image/*" />
          <?php 
          	if (isset($file2)){
          		echo "<img src='$file2'/>";
          	}
          ?>
          <p class="formHint"></p>
        </div>
        
        <div class="ctrlHolder">
          <label for="">โฉนด</label>
          <input type="file" id="" name="file3" size="35" class="fileUpload" accept="image/*"/>
          <?php 
          	if (isset($file3)){
          		echo "<img src='$file3'/>";
          	}
          ?>
          <p class="formHint"></p>
        </div>
        
        
        
        </fieldset>

      <div class="buttonHolder">
        <a href = "javascript:history.go(-1)" class="secondaryAction"> Go Back</a>
        <button type="submit" class="primaryAction">Submit</button>
      </div>

    </form>

            </div>
            <div id="right-column">
                <strong class="h">Quick Info</strong>
                <div class="box">This is your admin home page. It will give you access to all things within the back end system that you will need to facilitate a smooth operation.</div>
            </div>
        </div>
        <div id="footer"><p>Developed by <a href="http://twitter.com/umutm">Umut Muhaddisoglu</a> 2008. Updated for HTML5/CSS3 by <a href="http://mediagearhead.com">Giles Wells</a> 2010.</p></div>
    </div>
</body>
</html>